/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package xq.gwt.mvc.controller;
import xq.gwt.mvc.model.EntityArrayPropertyModel;
import xq.gwt.mvc.view.EntityArrayPropertyView;


/**
 *
 * @author admin
 */
public class EntityArrayPropertyController extends AbstractPropertyController{  
	private static final long serialVersionUID = -8832264155650756938L;
	protected EntityArrayPropertyView entitiesView;
    protected EntityArrayPropertyModel entitiesModel;

    public EntityArrayPropertyController(EntityArrayPropertyView view){
        super(view);
        this.entitiesView = view;
    }

    
    public void setPropertyModel(EntityArrayPropertyModel model){
        this.entitiesModel = model;
    	super.setPropertyModel(model);
    }

    @Override
	public void updateModel() {
		if (entitiesModel != null)
			entitiesModel.setValue(entitiesView.getEntities());

	}

    @Override
	public void updateView() {
		if (entitiesView != null)
			entitiesView.setEntities(entitiesModel.getValue());
	}


}
